<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="bp" value="${pageContext.request.contextPath}"></c:set>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<jsp:useBean id="timestamp" class="java.util.Date"/>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form>
    <input type="text" id="id">
    <input type="text" id="username">
    <input type="text" id="password">
    <input type="button" value="注册" onclick="zhuce()">


</form>

<script type="application/javascript">

    function zhuce() {
        var id = $("#id").val()
        var username = $("#username").val()
        var password = $("#password").val()
        $.ajax({
            type:"post",
            url:"${bp}/user/insert",
            data:{"id":id,"username":username,"password":password},
            success : function (msg) {
                if(msg == 2){
                    alert("注册成功")
                }else {
                    alert("注册失败")
                }


            }
        })
    }



</script>
</body>
<script src="${bp}/static/js/jquery-1.9.1.min.js"></script>
<script src="${bp}/static/js/jquery.cookie.js" type="text/javascript"></script>
<script src="${bp}/static/js/jquery.nicescroll.js" type="text/javascript"></script>
<script src="${bp}/static/js/BKframe.js" type="text/javascript"></script>
<script src="${bp}/static/js/html5shiv.js" type="text/javascript"></script>
<script src="${bp}/static/js/css3-mediaqueries.js" type="text/javascript"></script>
</html>
